﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Edit.Master" AutoEventWireup="true" 
    CodeBehind="SingleWellEntry.aspx.cs" Inherits="Web.Views.SingleWellManage.SingleWellEdit" %>

<%@ Register Src="~/UserControls/AttachmentManager.ascx" TagName="AttachmentManager"
    TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        var btnDelete_Click = function () {
            if (confirm('您确定要删除数据?')) {
                document.getElementById("ctl00_button_delete1").click();
            }
            else {
            }
        }


        $(function () {
            $("#ctl00_edit_ddlType").combobox({
                onSelect: function (record) {
                    $("#ctl00_edit_hd_button").click();
                }
            });
        });
    </script>
    <script src="../../Javascript/UserControls.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="button" runat="server">
    <div class="toolbar2">
        <button type="reset" class="sexybutton" runat="server" id="btnAddSingelWell" onserverclick="btnAddSingelWell_Click"
            visible="false">
            <span><span><span class="add">临时保存</span></span></span></button>
        <button type="button" class="sexybutton" runat="server" id="btnSaveAndGoon" onserverclick="btnSaveAndGoon_Click">
            <span><span><span class="edit">保存并继续录入</span></span></span></button>
        <button type="button" class="sexybutton" runat="server" id="btnSaveAndSendSingelWell"
            onserverclick="btnSaveAndSendSingelWell_Click">
            <span><span><span class="edit">
                <%=btnSaveAndSendSingelWellText%></span></span></span></button>
        <button type="button" class="sexybutton" runat="server" id="btnDelete1" onserverclick="btnDelete_Click"
            onclick="return btnDelete_Click();">
            <span><span><span class="edit">删除</span></span></span></button>
        <input type="submit" value="删除" runat="server" onserverclick="btnDelete_Click" id="delete1"
            style="display: none;" />
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="edit" runat="server">
    <div style="margin: 10px; margin-right: 10px;"> 
        <fieldset>
            <legend>元数据 </legend>
            <fieldset>
                <table cellpadding="0" cellspacing="0" width="100%" class="editTable">
                    <tr>
                        <th style="width: 12%">
                            文件名
                        </th>
                        <td colspan="4">
                            <asp:TextBox runat="server" ID="txtDatafileName" Width="100%"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <th style="width: 12%">
                            施工措施
                        </th>
                        <td>
                            <asp:TextBox runat="server" ID="txtWorkMode" Width="160px"></asp:TextBox>
                        </td>
                        <th style="width: 12%">
                            开工日期
                        </th>
                        <td>
                            <asp:TextBox runat="server" ID="txtBEGINDATE" Width="180px" class="easyui-datebox "
                                editable="false"></asp:TextBox>
                        </td>
                        <th style="width: 12%">
                            完工日期
                        </th>
                        <td>
                            <asp:TextBox runat="server" ID="txtFINISHDATE" Width="180px" class="easyui-datebox "
                                editable="false"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <th style="width: 12%">
                            A4
                        </th>
                        <td>
                            <asp:TextBox runat="server" ID="txtA4" Width="160px"></asp:TextBox>
                        </td>
                        <th style="width: 12%">
                            A3
                        </th>
                        <td>
                            <asp:TextBox runat="server" ID="txtA3" Width="160px"></asp:TextBox>
                        </td>
                        <th style="width: 12%">
                            A0
                        </th>
                        <td>
                            <asp:TextBox runat="server" ID="txtA0" Width="160px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <th>
                            井别
                        </th>
                        <td>
                            <asp:TextBox runat="server" ID="txtWellType" Width="160px"></asp:TextBox>
                        </td>
                        <th>
                            井号
                        </th>
                        <td>
                            <asp:TextBox runat="server" ID="txtWellCode" Width="160px"></asp:TextBox>
                        </td>
                        <th>
                        </th>
                        <td>
                        </td>
                    </tr>
                    <tr>
                               <th>
                            类别
                        </th>
                        <td>
                            <asp:DropDownList runat="server" ID="ddlType" class="easyui-combobox"  Width="160px"></asp:DropDownList>
                            <input id="hd_button" type="button" runat="server" onserverclick="ddlType_SelectedIndexChanged" style=" visibility:hidden;" />
                        </td>
                        <th>
                            类别明细
                        </th>
                        <td>
                            <asp:DropDownList runat="server" ID="ddlDetailType" class="easyui-combobox" Width="160px"></asp:DropDownList>
                            <%--<asp:HiddenField ID="hd_DetailType" runat="server" />--%>
                        </td>
                        <th>
                        </th>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <th>
                            开钻日期
                        </th>
                        <td>
                            <asp:TextBox runat="server" ID="txtBeginWorkDate" Width="180px" class="easyui-datebox "
                                editable="false"></asp:TextBox>
                        </td>
                        <th>
                            完钻日期
                        </th>
                        <td>
                            <asp:TextBox runat="server" ID="txtFinishWorkDate" Width="180px" class="easyui-datebox "
                                editable="false"></asp:TextBox>
                        </td>
                        <th>
                            完钻深度
                        </th>
                        <td>
                            <asp:TextBox runat="server" ID="txtWellDepth" Width="160px"></asp:TextBox>
                        </td>
                    </tr>
                </table>
            </fieldset>
            <fieldset>
                <legend>详细信息 </legend>
                <div>
                    <ep:epgridview id="gv_SingleWellDetail" runat="server" width="100%" ondatabound="gv_SingleWellDetail_OnDataBound"
                        autogeneratecolumns="false" onrowdeleting="gv_SingleWellDetail_RowDeleting" datakeynames="DETAILID">
                        <Columns>
                            <asp:TemplateField HeaderText="操作" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="6%">
                                <ItemTemplate>
                                    <asp:Button ID="btnDelete" runat="server" Text="删除" CssClass="btn" OnClientClick="return confirm('确定要删除该数据?');"
                                        CommandName="delete" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="DETAILID" Visible="false" />
                            <asp:HyperLinkField HeaderText="文件名" DataTextField="detailname" DataNavigateUrlFormatString="~/WebDoc/WebDoc.aspx?DETAILID={0}&pagenum={1}&AttachmentDBHelperString=SingleWell"
                                DataNavigateUrlFields="DETAILID,PageNum" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="40%">
                                <HeaderStyle Width="40%"></HeaderStyle>
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="40%" />
                            </asp:HyperLinkField>
                            <asp:BoundField HeaderText="A4" DataField="A4" ItemStyle-HorizontalAlign="Center">
                                <HeaderStyle Width="7%"></HeaderStyle>
                                <ItemStyle HorizontalAlign="Center" Width="7%"></ItemStyle>
                            </asp:BoundField>
                            <asp:BoundField HeaderText="A3" DataField="A3" ItemStyle-HorizontalAlign="Center">
                                <HeaderStyle Width="7%"></HeaderStyle>
                                <ItemStyle HorizontalAlign="Center" Width="7%"></ItemStyle>
                            </asp:BoundField>
                            <asp:BoundField HeaderText="A0" DataField="A0" ItemStyle-HorizontalAlign="Center">
                                <HeaderStyle Width="7%"></HeaderStyle>
                                <ItemStyle HorizontalAlign="Center" Width="7%"></ItemStyle>
                            </asp:BoundField>
                            <asp:BoundField HeaderText="定位页码" DataField="PageNum" HeaderStyle-Width="7%" ItemStyle-HorizontalAlign="Center" />
                        </Columns>
                    </ep:epgridview>
                </div>
                <div runat="server" id="detailDiv" visible="false">
                    <table cellpadding="0" cellspacing="0" width="100%" class="editTable">
                        <tr>
                            <th style="width: 5%">
                                文件名
                            </th>
                            <td style="width: 17%">
                                <asp:TextBox runat="server" ID="txtdetailname" Width="100%"></asp:TextBox>
                            </td>
                            <th style="width: 5%">
                                A4
                            </th>
                            <td style="width: 8%">
                                <asp:TextBox runat="server" ID="txtDetailA4" Width="100%"></asp:TextBox>
                            </td>
                            <th style="width: 5%">
                                A3
                            </th>
                            <td style="width: 8%">
                                <asp:TextBox runat="server" ID="txtDetailA3" Width="100%"></asp:TextBox>
                            </td>
                            <th style="width: 5%">
                                A0
                            </th>
                            <td style="width: 8%">
                                <asp:TextBox runat="server" ID="txtDetailA0" Width="100%"></asp:TextBox>
                            </td>
                            <th style="width: 5%">
                                定位页码
                            </th>
                            <td style="width: 8%">
                                <asp:TextBox runat="server" ID="txtPageNum" Width="100%"></asp:TextBox>
                            </td>
                        </tr>
                    </table>
                </div>
                <div>
                    <table>
                        <tr>
                            <td>
                                <asp:Button runat="server" ID="btnAddDetail" Text="添加详细" OnClick="btnAddDetail_Click" />
                            </td>
                            <td>
                                <asp:Button ID="btnSaveDetail" runat="server" Text="临时保存" Visible="false" OnClick="btnSaveDetail_Click" />
                            </td>
                        </tr>
                    </table>
                </div>
            </fieldset>
            <fieldset>
                <legend>附件信息</legend>
                <div runat="server" id="divAttach">
                    <uc1:AttachmentManager ID="amSingleWell" runat="server" DefaultType="*.pdf" AttachmentDBHelperString="SingleWell" />
                    <h3>
                        审核进度</h3>
                    <ep:epgridview id="gv_AprroveView" runat="server" width="100%">
                    </ep:epgridview>
                </div>
                <div runat="server" id="divGv">
                    <ep:epgridview id="gv_Attach" runat="server" width="100%">
                        <Columns>
                            <asp:HyperLinkField HeaderText="文件名称" DataTextField="attachmentname" DataNavigateUrlFormatString="~/WebDoc/WebDoc.aspx?AttachmentID={0}&AttachmentDBHelperString=SingleWell"
                                DataNavigateUrlFields="attachmentid" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="10%"
                                Target="_blank" />
                            <asp:BoundField HeaderText="上传时间" DataField="uploadtime" HeaderStyle-Width="10%"
                                ItemStyle-HorizontalAlign="Center" />
                            <asp:BoundField HeaderText="文件大小" DataField="attachmentsize" HeaderStyle-Width="10%"
                                ItemStyle-HorizontalAlign="Center" />
                            <asp:BoundField DataField="attachmentid" Visible="false" />
                        </Columns>
                    </ep:epgridview>
                </div>
            </fieldset>
        </fieldset>
    </div>
    <div>
        <asp:HiddenField ID="hdfCurrentStatusID" runat="server" />
    </div>
</asp:Content>
